package com.android.kotlin.util.user

/**
 * @Description: 登录状态的监听
 * @Author: xuwenlong
 * @Email: xuwenlong @ebrun.com
 * @Version:
 * @Create: 2019/2/26 0026
 * @Modify:
 */

object  LoginSucState{

    var listeners = ArrayList<LoginSucListener>()

    fun addListener(listener: LoginSucListener) {
        listeners.add(listener)
    }

    fun removeListener(listener: LoginSucListener) {
        listeners.remove(listener)
    }

    fun notifyLoginState(name: String, collectIds: List<Int>?) {
        for (listener in listeners) {
            listener.success(name, collectIds)
        }
    }
}